home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / devel / vbcc-68k-src / machines / amiga68k / libsrc / string / strncmp.c < prev    next >
C/C++ Source or Header  |  1999-01-01  |  257b  |  13 lines

  1. #include <string.h>
  2.  
  3. int strncmp(const char *s1,const char *s2,size_t n)
  4. /*  gehoert das so? */
  5. {
  6.     if(n==0) return 0;
  7.     while(--n&&*s1==*s2){
  8.         if(!*s1) return(0);
  9.         s1++;s2++;
  10.     }
  11.     return(*(unsigned char *)s1-*(unsigned char *)s2);
  12. }
  13.